home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / tcclib.exe / SCRMES.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-31  |  1.2 KB  |  51 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <conio.h>
  4. #include "tcclib.h"
  5.  
  6. void ScrollMessage (char *msg)
  7. {
  8.     char s1[999], s2[250]={"Press any key ..."}, s3[150], s4[150];
  9.     char scr[1200];
  10.     register int i, j;
  11.  
  12.     gettext( 3, 8, 77, 14, scr );
  13.     BlockErase( 3, 8, 77, 14 );
  14.     ExplodeBox( 5, 9, 76, 13 );
  15.     strcpy( s1, msg );
  16.  
  17.     i = ( 70 - strlen( s1 ) ) / 2;
  18.     while ( i-- ) {
  19.         strcpy( s3, s1 );
  20.         sprintf( s1, " %s", s3 );
  21.     }
  22.     i = strlen( s1 );
  23.     while ( i-- ) strcat( s1, " " );
  24.  
  25.     i = ( 70 - strlen( s2 ) ) / 2;
  26.     while ( i-- ) {
  27.         strcpy( s4, s2 );
  28.         sprintf( s2, " %s", s4 );
  29.     }
  30.     i = strlen( s2 );
  31.     while ( i-- ) strcat( s2, " " );
  32.  
  33.     sprintf( s3, "                                  %s", s1 );
  34.     strcpy( s1, s3 );
  35.     sprintf( s4, "%s                                  ", s2 );
  36.     strcpy( s2, s4 );
  37.  
  38.     for (i=1; i<36; ++i) {
  39.         strncpy( s3, s1+i, 70 );
  40.         strncpy( s4, s2+(70-i-34), 70 );
  41.         s3[70] = 0;
  42.         s4[70] = 0;
  43.         AtSay( 6, 10, s3 );
  44.         AtSay( 6, 12, s4 );
  45.         for (j=0; j<3000; ++j) ;
  46.     }
  47.  
  48.     GComm();
  49.     puttext( 3, 8, 77, 14, scr );
  50. }
  51.